package com.tom.architect.party3.day29.rxjava;

// 被观察者
public abstract class Observable<T> implements ObservableSource<T> {

    public static <T> ObservableSource<T> just(T item) {

        return onAssembly(new ObservableJust<T>(item));
    }

    private static <T> ObservableSource<T> onAssembly(ObservableJust<T> source) {
        // 预留...
        return source;
    }

    @Override
    public void subscribe(Observer<T> observer) {
        subscribeActual(observer);
    }

    protected abstract void subscribeActual(Observer<T> observer);

}
